package main

import "fmt"

type UserService interface {
	getUser()
}

func getUser(id int) User {
	fmt.Println("id =", id)
	return User{}
}

type User struct {
	name string
	age  int
}

func main() {

	//1
	var user1 = User{}
	user1.name = "张三"
	user1.age = 18
	fmt.Println("user1 =", user1)
	//2
	var user2 = User{"张三", 18}
	fmt.Println("user2 =", user2)
	//3
	user3 := User{}
	user3.name = "张三"
	user3.age = 18
	fmt.Println("user3 =", user3)

	//4
	user4 := User{"张三", 18}
	fmt.Println("user4 =", user4)
}
